var app = getApp();
var com = require('../../common.js');
Page({
  data: {},
  onLoad: function(options) {
    var _this = this
    _this.setData({
      id: options.id,
      userName:options.name
    })
    _this.onShopList(options.cid)
  },
  onShopList(e) {
    var _this = this
    com.link(app.link.onShoplistInfo + e + '.st', {}, function(res) {
      console.log(res);
      _this.setData({
        list: res.data.data
      })
    }, "GET")
  },
  onReady: function() {},
  onShow: function() {},
  onHide: function() {},
  onUnload: function() {},
  onPullDownRefresh: function() {},
  onReachBottom: function() {},
  onShareAppMessage: function() {},
  onSettingPage(e) {
    var _this = this,
      id = e.currentTarget.id
    wx.navigateTo({
      url: id == 1 ? '/pages/settingPage/settingPage?name=' + _this.data.userName+ '&id=' + _this.data.id + '&phone=' + e.currentTarget.dataset.phone : '/pages/orderInfoGrop/orderInfoGrop?search=' + e.currentTarget.dataset.name,
    })
  }
})